//
//  LTMessageApplyBody.m
//  LTIM
//
//  Created by 俊松何 on 2017/4/16.
//  Copyright © 2017年 俊松何. All rights reserved.
//

#import "LTMessageApplyBody.h"

@implementation LTMessageApplyBody


-(instancetype)initWithsinceUser:(LTUser *)sinceUser
              targetUser:(LTUser *)targetUser
                  reason:(NSString *)reason
                  status:(LTApplyState)status
                    type:(LTApplyType)type
{
    if(self = [super init])
    {
        _since = sinceUser;
        _target = targetUser;
        _sinceUserId = sinceUser.userId;
        _targetUserId = targetUser.userId;
        _reason = reason;
        _status = status;
        _isRead = 1;
        _applyMessageId = [self CreatemessageID];
        _createTime = [[NSDate date] timeIntervalSince1970] * 1000;
        _type = type;
    }




    return self;
}
-(NSString *)CreatemessageID
{
    CFUUIDRef uuidRef =CFUUIDCreate(NULL);
    
    CFStringRef uuidStringRef =CFUUIDCreateString(NULL, uuidRef);
    
    CFRelease(uuidRef);
    
    NSString *uniqueId = (__bridge NSString *)uuidStringRef;
    
    return uniqueId;
}
@end
